package cn.com.connected.common.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConfigurationProperties(prefix = "aliyun.properties.sms")
@Data
@Configuration
public class AliyunSmsProperties {
    private String regionId;

    private String accessKeyId;

    private String accessKeySecret;

    //短信签名
    private String signName;

    private String reg;

    private String login;

    private String findPwd;

    private String resetPwd;

    private String updateMobile;


    @Bean(name = "smsIAcsClient")
    public IAcsClient getSmsIAcsClient(){
        DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
        IAcsClient client = new DefaultAcsClient(profile);
        return client;
    }
}